/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJFrame.java
 *
 * Created on 05/08/2011, 18:54:20
 */
package GUI;

import java.awt.Color;
import javax.swing.JPanel;

/**
 *
 * @author Danny
 */
public class NewJFrame extends javax.swing.JFrame {

    Controller controller;

    /** Creates new form NewJFrame */
    public NewJFrame() {
        initComponents();
    }

    NewJFrame(Controller controller) {
        this.controller = controller;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Conditional Anonymity");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 643, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 482, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new NewJFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane jTabbedPane1;
    // End of variables declaration//GEN-END:variables

    void setTab(int i) {
        this.jTabbedPane1.setSelectedIndex(i);
    }

    void addTab(String string, JPanel panel1) {
        this.jTabbedPane1.addTab(string, panel1);
        if (jTabbedPane1.getTabCount() == 2) {
            this.jTabbedPane1.setForegroundAt(1, Color.red);
             this.jTabbedPane1.setBackgroundAt(1, Color.black);
              
        }
       

    }

    void disableTab(int i) {
        jTabbedPane1.setEnabledAt(1, false);
    }

    void enableTab(int index) {
        jTabbedPane1.setEnabledAt(index, true);
    }
}
